Salesforce UX API
TMF654- topupBalance towards Matrixx
Create Topup towards Matrixx (Rating system)
URL
https://[localhost]:[port]/sfdc-ux/v1/{businessId}/topupBalanceParam
| name | type | description | required | 
|---|---|---|---|
| businessId | string | 2 letter ISO 3166 country code (TT, BB, JM, PA, etc.) identifying the business unit. | Y | 
Header
| name | value | description | required | 
|---|---|---|---|
| client_id | string | The client_id identifying the channel. Minimum characters: 5 | Y | 
| client_secret | string | Password associated with the client_id. Minimum characters: 5 | Y | 
| lob | string | The Line of Business Identifier currently available are: FIXED PREPAID POSTPAID | Y | 
| channeId | string | Channel to business: Can be one of: "SFDC-B2C”, “SFDC-B2B" | Y | 
| targetSystem | String | This describes the end system request is for Eg: “Aria”, “Matrixx”. | Y | 
| X-Correlation-ID | string | Identifier that correlates HTTP request between a client and server. Any identification model (UUDI, checksum, etc.) can be used, as long as it is a unique value to differentiate a transaction. | Y | 
Request for Subscriber Recharge:
{
    "id": "ABC1111",
    "amount": {
        "amount": 1,
        "units": "USD"
    },
    "voucher": "fake-valid-nonce",
    "product": [
        {
            "id": "",
            "name": "RechargeOffer",
            "@type": "Offer"
        }
    ],
    "relatedParty": [
        {
            "id": "628935575",
            "@type": "PaymentGatewayUserId"
        },
        {
            "id": "0",
            "@type": "PaymentGatewayId"
        },
        {
            "id": "374373",
            "@type": "OrderItemId"
        }
    ],
    "partyAccount": {
        "id": "00116335_0000637717",
        "@type": "SubscriptionRef"
    },
    "paymentMethod": {
          "@type": "PaymentMethodResourceIdRef",
          "id": "3"
        },
    "channel": {
        "name": "sfdc-b2c",
        "id": ""
    }
}Request for Group Recharge:
{
    "id": "ABC1111",
    "description": "MtxRequestGroupPurchaseOffer",
    "amount": {
        "amount": 1,
        "units": "USD"
    },
    "voucher": "fake-valid-nonce",
    "product": [
        {
            "id": "",
            "name": "RechargeOffer",
            "@type": "Offer"
        }
    ],
    "relatedParty": [
        {
            "id": "628935575",
            "@type": "PaymentGatewayUserId"
        },
        {
            "id": "0",
            "@type": "PaymentGatewayId"
        },
        {
            "id": "374373",
            "@type": "OrderItemId"
        }
    ],
    "reason": "Low Balance",
    "partyAccount": {
        "id": "00116335_0000637717",
        "@type": "GroupSubscriptionRef"
    },
    "paymentMethod": {
          "@type": "PaymentMethodResourceIdRef",
          "id": "3"
        },
    "channel": {
        "name": "sfdc-b2c",
        "id": ""
    }
}Definitions
Each of the request parameters is detailed.
| name | type | description | required | 
|---|---|---|---|
| id | string | The unique order id used in the authorize or settlement request. This can be used to track the transaction and aids duplicate checking. | N | 
| description | string | Description of the recharge operation. Mandatory for group recharge | Y* | 
| amount | Quantity | An amount in a given unit | Y | 
| amount.amount | string | Top-Up Amount | Y | 
| amount.units | string | Unit | N | 
| product | array | A reference to the Product associated with this bucket. | N | 
| product.id | string | unique identifier | N | 
| product.name | string | Name of the related entity. | N | 
| product.@type | string | When sub-classing, this defines the sub-class Extensible name | N | 
| reason | string | Reason for recharge | N | 
| partyAccount | object | PartyAccount reference. A party account is an arrangement that a party has with an enterprise that | Y | 
| partyAccount.id | string | Either subscriber by ExternalID or associated device access number. For Group recharge, need to send "GroupExternalId" | Y | 
| partyAccount.@type | string | When sub-classing, this defines the sub-class entity name.  Values : Subscriber recharge : "SubscriptionRef" Group recharge : "GroupSubscriptionRef"  | N | 
| voucher | Nonce to use for authorization. Note - Either "PaymentMethodResourceId" or "voucher" only allow. Both should not allow | Y* | |
| relatedParty | array | Used to provide information about any other entity with relation to the operation | Y | 
| relatedParty.id | Unique identifier of a related entity. | Y | |
| paymentMethod | object | PaymentMethod reference | N | 
| paymentMethod.id | string | Payment method resource id. Note - Either "PaymentMethodResourceId" or "voucher" only allow. Both should not allow | Y* | 
| paymentMethod.@type | string | When sub-classing, this defines the sub-class Extensible name | N | 
relatedParty values
| name | type | description | required | 
|---|---|---|---|
| PaymentGatewayUserId | string | Identifier for the customer id on the payment gateway. | Y | 
| PaymentGatewayId | string | Identifier for the specific payment gateway. If not supplied, the default payment gateway will be used.", | Y | 
| OrderItemId | string | Order Item Id | Y | 
Response
{
    "id": "ABC1111",
    "confirmationDate": "2024-05-13T06:48:43.000Z",
    "status": "Approved",
    "amount": {
        "amount": 1,
        "units": "USD"
    },
    "voucher": "fake-valid-nonce",
    "product": [
        {
            "id": "0",
            "name": "RechargeOffer",
            "@type": "Offer"
        }
    ],
    "validFor": {
        "endDateTime": "65535-12-31T23:59:59.999999Z",
        "startDateTime": "2023-10-05T11:37:49.000Z"
    },
    "relatedParty": [
        {
            "id": "628935575",
            "@type": "PaymentGatewayUserId"
        },
        {
            "id": "0",
            "@type": "PaymentGatewayId"
        },
        {
            "id": "374373",
            "@type": "OrderItemId"
        }
    ],
    "bucket": {
        "id": "1",
        "name": "Prepaid Balance"
    },
    "paymentMethod": {
          "@type": "PaymentMethodResourceIdRef",
          "id": "3"
        },
    "impactedBucket": [
        {
            "amountAfter": 1.12,
            "name": "Total Amount",
            "item": [
                {
                    "amount": 0.11,
                    "name": "STATE SALES TAX"
                },
                {
                    "amount": 0.01,
                    "name": "CITY SALES TAX"
                }
            ]
        }
    ],
    "partyAccount": {
        "id": "00116335_0000637717",
        "@type": "GroupSubscriptionRef"
    }
}Definitions
Each of the request parameters is detailed.
| name | type | description | required | 
|---|---|---|---|
| confirmationDate | datetime | Date when the deduction was confirmed in the server | N | 
| status | string | Valid values for the Action Status Type | N | 
| validFor | object | A period of time, either as a deadline (endDateTime only) a startDateTime only, or both | N | 
| validFor.startDateTime | datetime | Start time of the balance. For a periodic or on-demand balance, it is the start time of the period. For a simple balance, it is the start validity time of the balance.", | N | 
| validFor.endDateTime | datetime | End time of the balance. For a periodic or on-demand balance, it is the end time of the period. For a simple balance, it is the end validity time of the balance.", | N | 
| bucket | object | link to the resource that holds bucket information | N | 
| bucket.id | string | Resource ID of balance instance. | N | 
| bucket.name | string | Name of balance template as defined in MATRIXX. | N | 
| impactedBucket | array | A list of impacted buckets | N | 
| impactedBucket.amountAfter | Quantity | Amount of balance update. | N | 
| impactedBucket.name | string | Total Amount | N | 
| impactedBucket.item | array | A list of impacted bucket items | N | 
| impactedBucket.item.amount | Quantity | Amount of balance update. | N | 
| impactedBucket.item.name | string | Tax name | N | 
| and concatenated the complete request body | N | 
Possible response error
In this section all the possible data structures received by the client are defined and that must be considered as unsatisfactory when responding to the method.
[ 400 ]
Bad Request - the request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.
{
  "errors" : [{
      "code" : 400,
      "message" : "The request is invalid or not properly formed.",
      "description" : "Malformed request syntax, invalid request message framing, or deceptive request routing."
    }]
}[ 401 ]
Unauthorized - The request has not been applied because it lacks valid authentication credentials for the target resource.
{
  "errors" : [{
      "code" : 401,
      "message" : "The user could not be authenticated for this request.",
      "description" : "The request has not been applied because it lacks valid authentication credentials for the target resource"
    }]
}[ 404 ]
Not Found - server has not found a resource with that URI. This may be temporary and permanent condition. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.
{
  "errors" : [{
      "code" : 404,
      "message" : "The request is invalid or not properly formed.",
      "description" : "The requested operation failed because a resource associated with the request could not be found."
    }]
}[ 405 ]
Method Not Allowed - HTTP method not allowed for this resource. The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.
{
    "errors": [{
            "code": 405,
             "message": "APIKIT:METHOD_NOT_ALLOWED",
             "description": "HTTP Method DELETE not allowed for : /{businessId}/topupbalance"
        }]
}[ 500 ]
Internal Server Error - server encountered an error processing request. This should not happen normally, but it is a generic error message, given when no more specific message is suitable.
{
  "errors" : [{
      "code" : 500,
      "message" : "Internal Server Error",
      "description": "The request failed due to an internal error"
    }]
}[ 501 ]
Not implemented - indicates that the server does not support the functionality required to fulfill the request. This is the appropriate response when the server does not recognize the request method and is not capable of supporting it for any resource.
{
  "errors" : [{
      "code" : 501,
      "message" : "Not implemented",
      "description" : "Operation POST /topupbalance for Business Id: xxxx not implemented"
    }]
  }